﻿using System.Web.Mvc;
using System.Web.Routing;

namespace QAS.Nekorama
{
    /// <summary>
    /// ルート設定
    /// </summary>
    public class RouteConfig
    {
        /// <summary>
        /// 登録ルート
        /// </summary>
        /// <param name="routes">ルート</param>
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute("Default", "{controller}/{action}/{id}",
                new {controller = "Question", action = "Index", id = UrlParameter.Optional}
                );
            routes.MapRoute("NewQ", "{controller}/{action}/{id}",
                new {controller = "Question", action = "Create", id = UrlParameter.Optional}
                );
            routes.MapRoute("NewQuestion/GetTags", "{controller}/{action}/{id}",
                new {controller = "Question", action = "GetTags", id = UrlParameter.Optional}
                );
            routes.MapRoute("editQ", "{controller}/{action}/{id}",
                new {controller = "Question", action = "Edit", id = UrlParameter.Optional}
                );
            routes.MapRoute("Details", "Question/Details/{id}",
                new { controller = "Question", action = "Details", id = @"\d+" }
                );
            routes.MapRoute("UserDetails", "User/Details/{id}",
                new { controller = "User", action = "Details", id = @"\d+" }
                );
        }
    }
}